# Include headers
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/tools)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/tools/ConvexHull)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

# CGAL
IF (CGAL_FOUND)
    ADD_DEFINITIONS(-DWITH_CGAL)
ENDIF (CGAL_FOUND)

# Include Qhull
IF (QHULL_FOUND)
    ADD_DEFINITIONS(-DWITH_QHULL)
ENDIF (QHULL_FOUND)

# Include Triangle
IF (TRIANGLE_FOUND)
    ADD_DEFINITIONS(-DWITH_TRIANGLE)
ENDIF (TRIANGLE_FOUND)

# Enumerate source files
FILE(GLOB_RECURSE TEST_SRC_FILES *.cpp)
FILE(GLOB_RECURSE TEST_INC_FILES *.h *.inl)

ADD_EXECUTABLE(convex_hull_tests ${TEST_SRC_FILES} ${TEST_INC_FILES})
TARGET_LINK_LIBRARIES(convex_hull_tests ${GTEST_BOTH_LIBRARIES} Mesh lib_convex_hull)
ADD_CUSTOM_COMMAND(TARGET convex_hull_tests POST_BUILD COMMAND convex_hull_tests)
